#include <iostream>
#include <signal.h>
#include <unistd.h>
using namespace std;
void sigHandler(int sig)
{
    cout << "the signal is " << sig << endl;
}
int main(int argc, char *argv[])
{
    struct sigaction act, oldAct;
    act.sa_flags = 0;
    sigfillset(&act.sa_mask); // 屏蔽其他信号；
    act.sa_handler = sigHandler;
    sigaction(SIGINT, &act, &oldAct);
    pause();
    return 0;
}